package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.BusinessticketsrelyModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by xiO on 2016/11/18.
 */
@Transactional
public interface BusinessticketsRelyRepository extends JpaRepository<BusinessticketsrelyModel, Integer>,
        JpaSpecificationExecutor<BusinessticketsrelyModel> {

    @Query("select u from BusinessticketsrelyModel u where u.btRelyProductId=?1 and u.btTrueIds=?2 and u.btStatus='已导出'  ")
    BusinessticketsrelyModel getBmodelByIdAndproductIds(String productids, int trueid);

    @Query("select u from BusinessticketsrelyModel u where u.btRelyProductId=?1  ")
    BusinessticketsrelyModel getBmodelByIdAndproductIdsNotstatus(String productids);

    @Query("select u from BusinessticketsrelyModel u where u.vrTicketsNo=?1 and u.btTrueIds=?2  ")
    List<BusinessticketsrelyModel> getBmodelByIdAndVrTicketsNo(String vrTicketsNo, int trueid);



}
